package workermanage;

import java.sql.*;


public class work{
	
	protected String id;
	protected String password;
	protected String name;
	protected String section;
	protected String address;
	protected int age;

	public ResultSet execute(String sql) {
		ResultSet rs=null;
		try
		{
			dbsql dbsm = new dbsql();   
			dbsm.setSqlStr(sql);
			dbsm.executeQuery();
			rs=dbsm.getRs();			
		}
		catch (Exception e) {
			System.out.println(e.toString());
		}
		return rs;
	}

	public boolean update(String sql) {
		ResultSet rs=null;
		try
		{
			dbsql dbsm = new dbsql();
			dbsm.setSqlStr(sql);
			dbsm.executeUpdate();
			dbsm.close();
			return true;
		}
		catch (Exception e) {
			System.out.println(e.toString());
			return false;
		}
		
	}
	
	public void setid(String newid) {
	        this.id = newid;
	    	}
	    	
	public String getid() {
		return id;
	}
	
	public void setpassword(String newpassword) {
        this.password = newpassword;
    	}
    	

	public String getpassword() {
		return password;

	}
	public void setname(String newname) {
	        this.name = newname;
	    	}
	    	
	public String getname() {
		return name;
	}
	
	public void setsection(String newsection) {
        this.section = newsection;
    	}
    	
    public String getsection() {
	   return section;
    }
    
    public void setshool(String newaddress) {
        this.address = newaddress;
    	}
    	
    public String getaddress() {
	   return address;
    }
    
	public void setage(int newage) {
	        this.age = newage;
	    	}
	    	
	public int getage() {
		return age;
	}
};
